package com.saifan.wyy_ov.ui.communitycenter;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import com.saifan.wyy_ov.R;
import com.saifan.wyy_ov.ui.view.BaseActivity;
import com.saifan.wyy_ov.utils.CommonAdapter;
import com.saifan.wyy_ov.utils.ViewHolderHelper;

import java.util.ArrayList;

/**
 * @version V1.0.0
 * @author: lomasky
 * @date: 2015-05-05 14:41
 * @descrption 我的优惠劵
 */
public class DiscountcouponActivity extends BaseActivity implements AdapterView.OnItemClickListener {

    private Toolbar toolbar;
    private ListView listView;
    private ArrayList<String[]> list;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_discountcoupon);
        findViews();
        test();
    }

    private void test() {
        list= new ArrayList<>();
        String[] stringss = new String[]{"1", "2dddd", "4ddddddd"};
        list.add(stringss);
        for (int i = 0; i < 10; i++) {
            String[] strings = new String[]{"1", "2", "3",};
            list.add(strings);
        }
        listView.setAdapter(new CommonAdapter<String[]>(this,list,R.layout.discountcoupon_item) {
            @Override
            public void convert(ViewHolderHelper helper, String[] item) {

            }
        });
        listView.setOnItemClickListener(this);
    }

    private void findViews() {
        this.listView = (ListView) findViewById(R.id.listView);
        this.toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);


    }






    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        Intent intent= new Intent();
        intent.setClass(this,DiscountcouponItemActivity.class);
        startActivity(intent);

    }
}
